import request from '@/utils/request'

export function createPage(data) {
  return request({
    url: '/lowcode/page',
    method: 'post',
    data
  })
}

export function getPage(id) {
  return request({
    url: `/lowcode/page/${id}`,
    method: 'get'
  })
}

export function listPages(pageNum = 1, pageSize = 10) {
  return request({
    url: '/lowcode/page/list',
    method: 'get',
    params: { pageNum, pageSize }
  })
}

export function updatePage(id, data) {
  return request({
    url: `/lowcode/page/${id}`,
    method: 'put',
    data
  })
}

export function deletePage(id) {
  return request({
    url: `/lowcode/page/${id}`,
    method: 'delete'
  })
}
